<!--第四课内容 -->
{% extends 'base/layout.html' %}

<!--第四课内容 下面是正文-->
{% block content %}
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>首页</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <form id="my-awesome-dropzone" class="dropzone" action="/upload_excel">
                                <div class="dropzone-previews"></div>
                                <button type="submit" class="btn btn-primary pull-right">上传服务器</button>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <script>
        $(document).ready(function () {

            Dropzone.options.myAwesomeDropzone = {

                autoProcessQueue: false,
                uploadMultiple: true,
                parallelUploads: 100,
                maxFiles: 100,

                // Dropzone settings
                init: function () {
                    var myDropzone = this;

                    this.element.querySelector("button[type=submit]").addEventListener("click", function (e) {
                        e.preventDefault();
                        e.stopPropagation();
                        myDropzone.processQueue();
                    });
                    this.on("sendingmultiple", function () {
                    });
                    this.on("successmultiple", function (files, response) {
                        window.location.reload()
                    });
                    this.on("errormultiple", function (files, response) {
                    });
                }

            }

        });
    </script>


{% endblock %}


